import request from '@/utils/request'
export const getemployee = params => {
  return request({
    url: '/sys/user',
    params
  })
}

// 批量导出
export const exportExcel = () => {
  return request({
    url: '/sys/user/export',
    responseType: 'blob'
  })
}
// 删除员工
export const delemployee = id => {
  return request({
    url: `/sys/user/${id}`,
    method: 'DELETE'
  })
}
// 下载导入模板
export const downfile = () => {
  return request({
    url: '/sys/user/import/template',
    responseType: 'blob'

  })
}
// 导入excel'接口
export const importExcel = data => {
  return request({
    url: '/sys/user/import',
    data,
    method: 'POST'
  })
}
// 获取员工基本信息
export const oneemployee = id => {
  return request({
    url: `/sys/user/${id}`
  })
}
// 新增员工
export const addemployee = data => {
  return request({
    url: `/sys/user`,
    method: 'POST',
    data
  })
}
// 修改员工信息
export const editemployee = data => {
  return request({
    url: `/sys/user/${data.id}`,
    method: 'PUT',
    data
  })
}
// 为员工分配角色
export const assignRole = data => {
  return request({
    method: 'PUT',
    url: '/sys/user/assignRoles',
    data
  })
}
